Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(bid-script/gpu): support model[.vram][.interface] pricing +add fallback logic if vram/interface were not priced before catchall #265

Merged

Conversation

andy108369
Copy link
Collaborator

Tests:

PCIe interface

$ cat gpu-count-1_expected_80Gi_vram_interface_PCIe.jq 
{
  "resources": [
    {
      "memory": 2147483648,
      "cpu": 1000,
      "gpu": {
        "units": 1,
        "attributes": {
          "vendor": {
            "nvidia": {
              "model": "a100",
              "ram": "80Gi",
              "interface": "pcie"
            }
          }
        }
      },
      "storage": [
        {
          "class": "ephemeral",
          "size": 5368709120
        }
      ],
      "count": 2,
      "endpoint_quantity": 2,
      "ip_lease_quantity": 0
    }
  ],
  "price": {
    "denom": "uakt",
    "amount": "1000000.000000000000000000"
  },
  "price_precision": 6
}

$ PRICE_TARGET_GPU_MAPPINGS="a100=900,a100.40Gi=900,a100.40Gi.pcie=900,a100.80Gi=1002,a100.80Gi.pcie=1003,*=1200" DEBUG_BID_SCRIPT=1 $S < gpu-count-1_expected_80Gi_vram_interface_PCIe.jq 
DEBUG: gpu_unit_max_price 1200
DEBUG: model a100.80Gi.pcie
DEBUG: price for this model 1003
DEBUG: gpu_units 1
DEBUG: gpu_price_total 2006
DEBUG: count 2
DEBUG: Total cost USD/month: 2012.70000000000000
879.518503

SXM4 interface

$ cat gpu-count-1_expected_80Gi_vram_interface_SXM4.jq
{
  "resources": [
    {
      "memory": 2147483648,
      "cpu": 1000,
      "gpu": {
        "units": 1,
        "attributes": {
          "vendor": {
            "nvidia": {
              "model": "a100",
              "ram": "80Gi",
              "interface": "sxm4"
            }
          }
        }
      },
      "storage": [
        {
          "class": "ephemeral",
          "size": 5368709120
        }
      ],
      "count": 2,
      "endpoint_quantity": 2,
      "ip_lease_quantity": 0
    }
  ],
  "price": {
    "denom": "uakt",
    "amount": "1000000.000000000000000000"
  },
  "price_precision": 6
}

$ PRICE_TARGET_GPU_MAPPINGS="a100=900,a100.40Gi=900,a100.40Gi.pcie=900,a100.80Gi=1002,a100.80Gi.sxm4=1003,*=1200" DEBUG_BID_SCRIPT=1 $S < gpu-count-1_expected_80Gi_vram_interface_SXM4.jq 
DEBUG: gpu_unit_max_price 1200
DEBUG: model a100.80Gi.sxm4
DEBUG: price for this model 1003
DEBUG: gpu_units 1
DEBUG: gpu_price_total 2006
DEBUG: count 2
DEBUG: Total cost USD/month: 2012.70000000000000
879.518503

@andy108369 andy108369 merged commit c762e1a into akash-network:main Mar 27, 2024
1 of 2 checks passed
@andy108369 andy108369 changed the title Bidpricescript price gpu interface feat(bid-script/gpu): support model[.vram][.interface] pricing +add fallback logic if vram/interface were not priced before catchall Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant